<%@ include file="/common/taglibs.jsp"%>

<table id="instHeaderTable" class="reference">

<s:set var="sum" value="0" />
	<s:iterator value="results" status="rowstatus">

<s:if test="#rowstatus.index == 0">
		<br>
         Student Name: <s:property value="user.firstName" /><s:property value="user.lastName" /><br><br>
		 Class       :<s:property value="classYear.name" /><br><br>
		 Section     :<s:property value="section.sectionName" /><br><br>
		 Examination :<s:property value="examination.examName" /><br><br><br>
	<tr>
		
		<th>Subject</th>				
		<th>Marks </th>
		<th>Max Mark</th>
		<th>Class Avg</th>
	</tr>
</s:if>
	<tr>
		<%-- <td>
			<a href='/editResult?method=showResultsByCandidate&studentId=${user.id}&academicYear=${academicYear}&classYear=${classYear}&sectionName${sectionName}&examName=${examName}'>
				<s:property value="user.id" />
			</a>
		</td>
		 --%>
		<td><s:property value="subject.subjectName" /></td>
		<td><s:property value="mark" /></td>
		<s:iterator value="examination.examPapers" status="rowstatus">
		<s:if test="subjectId==subject.id">
			<td><s:property value="maxMark" /></td>
		</s:if>	
		</s:iterator>
		<td><s:property value="avgMark" /></td>
		<c:set var="sum" value="${sum + mark}" />
	</tr>
	</s:iterator>
	<tr>
		<td>Total</td>
		<td>${sum}</td>
		<td></td>
		<td></td>
	</tr>
</table>
